package com.online.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(value = "/page")
public class pageController {

    @RequestMapping(value = "/goUserLogin")
    public String goUserLogin() {
        return "user/userLogin";
    }

    @RequestMapping(value = "/goExamAdd")
    public String goExamAdd() {

        return "teacher/add_exam";
    }

    @RequestMapping(value = "/goExamDetail")
    public String goExamDetail() {
        return "teacher/exam_detail";
    }

    @RequestMapping(value = "/goAnswerPaper")
    public String goAnswerPaper() {
        return "student/student_answer_paperList";
    }

    @RequestMapping(value = "/goAddACourse")
    public String goAddCourse() {
        return "teacher/add_course";
    }

    @RequestMapping(value = "/goUserIndex",method = RequestMethod.GET)
    public String goUserIndex() {
        return "user/index";
    }

    @RequestMapping(value = "/goUserMain")
    public String goUserMain() {
        return "user/main";
    }

    @RequestMapping(value = "/goTeacherClassList")
    public String goTeacherClassList() {
        return "teacher/class_list";
    }

    @RequestMapping(value = "/goAddClass")
    public String goAddClass() {
        return "teacher/add_class";
    }

    @RequestMapping(value = "goAddStudent")
    public String goAddStudent() {
        return "teacher/add_student";
    }

    @RequestMapping(value = "goAddAStudent")
    public String goAddAStudent() {
        return "teacher/add_astudent";
    }

    @RequestMapping(value = "goImportStudent")
    public String goImportStudent() {
        return "teacher/import_student";
    }

    @RequestMapping(value = "/goStudentCourse")
    public String goStudentCourse() {
        return "student/student_course";
    }

    @RequestMapping(value = "/goTeacherRegister")
    public String goTeacherRegister() {
        return "teacher/getVerificationCode";
    }

    @RequestMapping(value = "/goInsertOption")
    public String goInsertOption() {
        return "admin/insert_option";
    }

    @RequestMapping(value = "/goInsertBlank")
    public String goInsertBlank() {
        return "admin/insert_blank";
    }

    @RequestMapping(value = "/goCourseIndex")
    public String goCourseIndex(HttpServletRequest request) {
        String courseId = request.getParameter("courseId");
        String courseName = request.getParameter("courseName");
        request.setAttribute("courseName",courseName);
        request.setAttribute("courseId",courseId);
        return "teacher/course_index";
    }

    @RequestMapping(value = "/goAddCourseTest")
    public String goCourseTest(HttpServletRequest request) {
        String courseId =  request.getParameter("courseId");
        request.setAttribute("courseId",courseId);
        return "teacher/add_course_test";
    }

    @RequestMapping(value = "/goResetPassword")
    public String goRestPassword(){
        return "teacher/reset_password";
    }
}

